home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 January: Mac OS SDK / Dev.CD Jan 00 SDK1.toast / Development Kits / Mac OS / ColorSync 3.0 Mac SDK / Interfaces / CMMComponent.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-28  |  12.4 KB  |  412 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMMComponent.h
  3.  
  4.      Contains:    ColorSync CMM Component API
  5.  
  6.      Version:    Technology:    ColorSync 2.6
  7.                  Release:    ColorSync 3.0 SDK for use with Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1994-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CMMCOMPONENT__
  18. #define __CMMCOMPONENT__
  19.  
  20. #ifndef __QUICKDRAW__
  21. #include <Quickdraw.h>
  22. #endif
  23.  
  24. #ifndef __COMPONENTS__
  25. #include <Components.h>
  26. #endif
  27.  
  28. #ifndef __CMAPPLICATION__
  29. #include <CMApplication.h>
  30. #endif
  31.  
  32.  
  33.  
  34.  
  35. #if PRAGMA_ONCE
  36. #pragma once
  37. #endif
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43. #if PRAGMA_IMPORT
  44. #pragma import on
  45. #endif
  46.  
  47. #if PRAGMA_STRUCT_ALIGN
  48.     #pragma options align=mac68k
  49. #elif PRAGMA_STRUCT_PACKPUSH
  50.     #pragma pack(push, 2)
  51. #elif PRAGMA_STRUCT_PACK
  52.     #pragma pack(2)
  53. #endif
  54.  
  55. enum {
  56.     CMMInterfaceVersion            = 1
  57. };
  58.  
  59.  
  60. /* Component function selectors */
  61. enum {
  62.                                                                 /* Required */
  63.     kNCMMInit                    = 6,
  64.     kCMMMatchColors                = 1,
  65.     kCMMCheckColors                = 2,
  66.  
  67.                                                                 /* Optional */
  68.     kCMMValidateProfile            = 8,
  69.     kCMMMatchBitmap                = 9,
  70.     kCMMCheckBitmap                = 10,
  71.     kCMMMatchPixMap                = 3,
  72.     kCMMCheckPixMap                = 4,
  73.     kCMMConcatenateProfiles        = 5,
  74.     kCMMConcatInit                = 7,
  75.     kCMMNewLinkProfile            = 16,
  76.     kNCMMConcatInit                = 18,
  77.     kNCMMNewLinkProfile            = 19,
  78.     kCMMGetPS2ColorSpace        = 11,
  79.     kCMMGetPS2ColorRenderingIntent = 12,
  80.     kCMMGetPS2ColorRendering    = 13,
  81.     kCMMGetPS2ColorRenderingVMSize = 17,
  82.  
  83.                                                                 /* obsolete with ColorSync 2.5 */
  84.     kCMMFlattenProfile            = 14,
  85.     kCMMUnflattenProfile        = 15,
  86.  
  87.                                                                 /* obsolete with ColorSync 2.6 */
  88.     kCMMInit                    = 0,
  89.     kCMMGetNamedColorInfo        = 70,
  90.     kCMMGetNamedColorValue        = 71,
  91.     kCMMGetIndNamedColorValue    = 72,
  92.     kCMMGetNamedColorIndex        = 73,
  93.     kCMMGetNamedColorName        = 74
  94. };
  95.  
  96. enum {
  97.     kCMMOpen                    = kComponentOpenSelect,
  98.     kCMMClose                    = kComponentCloseSelect,
  99.     kCMMGetInfo                    = kComponentVersionSelect
  100. };
  101.  
  102. #if TARGET_API_MAC_OS8
  103. typedef ComponentInstance                 CMMComponentInst;
  104. EXTERN_API( CMError )
  105. NCMMInit                        (CMMComponentInst         cmm,
  106.                                  CMProfileRef             srcProfile,
  107.                                  CMProfileRef             dstProfile)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0006, 0x7000, 0xA82A);
  108.  
  109. EXTERN_API( CMError )
  110. CMMInit                            (CMMComponentInst         cmm,
  111.                                  CMProfileHandle         srcProfile,
  112.                                  CMProfileHandle         dstProfile)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0000, 0x7000, 0xA82A);
  113.  
  114. EXTERN_API( CMError )
  115. CMMMatchColors                    (CMMComponentInst         cmm,
  116.                                  CMColor *                colors,
  117.                                  UInt32                 count)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0001, 0x7000, 0xA82A);
  118.  
  119. EXTERN_API( CMError )
  120. CMMCheckColors                    (CMMComponentInst         cmm,
  121.                                  CMColor *                colors,
  122.                                  UInt32                 count,
  123.                                  UInt32 *                result)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0002, 0x7000, 0xA82A);
  124.  
  125. EXTERN_API( CMError )
  126. CMMValidateProfile                (CMMComponentInst         cmm,
  127.                                  CMProfileRef             prof,
  128.                                  Boolean *                valid)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);
  129.  
  130. EXTERN_API( CMError )
  131. CMMFlattenProfile                (CMMComponentInst         cmm,
  132.                                  CMProfileRef             prof,
  133.                                  UInt32                 flags,
  134.                                  CMFlattenUPP             proc,
  135.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x000E, 0x7000, 0xA82A);
  136.  
  137. EXTERN_API( CMError )
  138. CMMUnflattenProfile                (CMMComponentInst         cmm,
  139.                                  FSSpec *                resultFileSpec,
  140.                                  CMFlattenUPP             proc,
  141.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x000F, 0x7000, 0xA82A);
  142.  
  143. EXTERN_API( CMError )
  144. CMMMatchBitmap                    (CMMComponentInst         cmm,
  145.                                  CMBitmap *                bitmap,
  146.                                  CMBitmapCallBackUPP     progressProc,
  147.                                  void *                    refCon,
  148.                                  CMBitmap *                matchedBitmap)                        FIVEWORDINLINE(0x2F3C, 0x0010, 0x0009, 0x7000, 0xA82A);
  149.  
  150. EXTERN_API( CMError )
  151. CMMCheckBitmap                    (CMMComponentInst         cmm,
  152.                                  const CMBitmap *        bitmap,
  153.                                  CMBitmapCallBackUPP     progressProc,
  154.                                  void *                    refCon,
  155.                                  CMBitmap *                resultBitmap)                        FIVEWORDINLINE(0x2F3C, 0x0010, 0x000A, 0x7000, 0xA82A);
  156.  
  157. EXTERN_API( CMError )
  158. CMMMatchPixMap                    (CMMComponentInst         cmm,
  159.                                  PixMap *                pixMap,
  160.                                  CMBitmapCallBackUPP     progressProc,
  161.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0003, 0x7000, 0xA82A);
  162.  
  163. EXTERN_API( CMError )
  164. CMMCheckPixMap                    (CMMComponentInst         cmm,
  165.                                  const PixMap *            pixMap,
  166.                                  CMBitmapCallBackUPP     progressProc,
  167.                                  BitMap *                bitMap,
  168.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x0004, 0x7000, 0xA82A);
  169.  
  170. EXTERN_API( CMError )
  171. CMMConcatInit                    (CMMComponentInst         cmm,
  172.                                  CMConcatProfileSet *    profileSet)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  173.  
  174. EXTERN_API( CMError )
  175. NCMMConcatInit                    (CMMComponentInst         cmm,
  176.                                  NCMConcatProfileSet *    profileSet,
  177.                                  CMConcatCallBackUPP     proc,
  178.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0012, 0x7000, 0xA82A);
  179.  
  180. EXTERN_API( CMError )
  181. CMMNewLinkProfile                (CMMComponentInst         cmm,
  182.                                  CMProfileRef *            prof,
  183.                                  const CMProfileLocation * targetLocation,
  184.                                  CMConcatProfileSet *    profileSet)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0010, 0x7000, 0xA82A);
  185.  
  186. EXTERN_API( CMError )
  187. NCMMNewLinkProfile                (CMMComponentInst         cmm,
  188.                                  CMProfileRef             prof,
  189.                                  NCMConcatProfileSet *    profileSet,
  190.                                  CMConcatCallBackUPP     proc,
  191.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x0013, 0x7000, 0xA82A);
  192.  
  193. EXTERN_API( CMError )
  194. CMMGetPS2ColorSpace                (CMMComponentInst         cmm,
  195.                                  CMProfileRef             srcProf,
  196.                                  UInt32                 flags,
  197.                                  CMFlattenUPP             proc,
  198.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x000B, 0x7000, 0xA82A);
  199.  
  200. EXTERN_API( CMError )
  201. CMMGetPS2ColorRenderingIntent    (CMMComponentInst         cmm,
  202.                                  CMProfileRef             srcProf,
  203.                                  UInt32                 flags,
  204.                                  CMFlattenUPP             proc,
  205.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x000C, 0x7000, 0xA82A);
  206.  
  207. EXTERN_API( CMError )
  208. CMMGetPS2ColorRendering            (CMMComponentInst         cmm,
  209.                                  CMProfileRef             srcProf,
  210.                                  CMProfileRef             dstProf,
  211.                                  UInt32                 flags,
  212.                                  CMFlattenUPP             proc,
  213.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0014, 0x000D, 0x7000, 0xA82A);
  214.  
  215. EXTERN_API( CMError )
  216. CMMGetPS2ColorRenderingVMSize    (CMMComponentInst         cmm,
  217.                                  CMProfileRef             srcProf,
  218.                                  CMProfileRef             dstProf,
  219.                                  UInt32 *                vmSize)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0011, 0x7000, 0xA82A);
  220.  
  221. EXTERN_API( CMError )
  222. CMMConcatenateProfiles            (CMMComponentInst         cmm,
  223.                                  CMProfileHandle         thru,
  224.                                  CMProfileHandle         dst,
  225.                                  CMProfileHandle *        newDst)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0005, 0x7000, 0xA82A);
  226.  
  227. EXTERN_API( CMError )
  228. CMMGetNamedColorInfo            (CMMComponentInst         cmm,
  229.                                  CMProfileRef             srcProf,
  230.                                  UInt32 *                deviceChannels,
  231.                                  OSType *                deviceColorSpace,
  232.                                  OSType *                PCSColorSpace,
  233.                                  UInt32 *                count,
  234.                                  StringPtr                 prefix,
  235.                                  StringPtr                 suffix)                                FIVEWORDINLINE(0x2F3C, 0x001C, 0x0046, 0x7000, 0xA82A);
  236.  
  237. EXTERN_API( CMError )
  238. CMMGetNamedColorValue            (CMMComponentInst         cmm,
  239.                                  CMProfileRef             prof,
  240.                                  StringPtr                 name,
  241.                                  CMColor *                deviceColor,
  242.                                  CMColor *                PCSColor)                            FIVEWORDINLINE(0x2F3C, 0x0010, 0x0047, 0x7000, 0xA82A);
  243.  
  244. EXTERN_API( CMError )
  245. CMMGetIndNamedColorValue        (CMMComponentInst         cmm,
  246.                                  CMProfileRef             prof,
  247.                                  UInt32                 index,
  248.                                  CMColor *                deviceColor,
  249.                                  CMColor *                PCSColor)                            FIVEWORDINLINE(0x2F3C, 0x0010, 0x0048, 0x7000, 0xA82A);
  250.  
  251. EXTERN_API( CMError )
  252. CMMGetNamedColorIndex            (CMMComponentInst         cmm,
  253.                                  CMProfileRef             prof,
  254.                                  StringPtr                 name,
  255.                                  UInt32 *                index)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0049, 0x7000, 0xA82A);
  256.  
  257. EXTERN_API( CMError )
  258. CMMGetNamedColorName            (CMMComponentInst         cmm,
  259.                                  CMProfileRef             prof,
  260.                                  UInt32                 index,
  261.                                  StringPtr                 name)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x004A, 0x7000, 0xA82A);
  262.  
  263. #if OLDROUTINENAMES
  264. #define NCMInit(cmm, srcProfile, dstProfile)    NCMMInit(cmm, srcProfile, dstProfile)
  265. #define CMInit(cmm, srcProfile, dstProfile)    CMMInit(cmm, srcProfile, dstProfile)
  266. #define CMMatchColors(cmm, colors, count)        CMMMatchColors(cmm, colors, count)
  267. #define CMCheckColors(cmm, colors, count, result)    CMMCheckColors(cmm, colors, count, result)
  268. #define CMMatchBitmap(cmm, bitmap, progressProc, refCon, matchedBitmap)    CMMMatchBitmap(cmm, bitmap, progressProc, refCon, matchedBitmap)
  269. #define CMCheckBitmap(cmm, bitmap, progressProc, refCon, resultBitmap)    CMMCheckBitmap(cmm, bitmap, progressProc, refCon, resultBitmap)
  270. #define CMMatchPixMap(cmm, pixMap, progressProc, refCon)    CMMMatchPixMap(cmm, pixMap, progressProc, refCon)
  271. #define CMCheckPixMap(cmm, pixMap, progressProc, bitMap, refCon)    CMMCheckPixMap(cmm, pixMap, progressProc, bitMap, refCon)
  272. #define CMConcatInit(cmm, profileSet)    CMMConcatInit(cmm, profileSet)
  273. #define CMConcatenateProfiles(cmm, thru, dst, newDst) CMMConcatenateProfiles(cmm, thru, dst, newDst)
  274. #define CMNewLinkProfile(cmm, prof, targetLocation, profileSet)    CMMNewLinkProfile(cmm, prof, targetLocation, profileSet)
  275. #endif  /* OLDROUTINENAMES */
  276.  
  277. #else
  278. EXTERN_API( CMError )
  279. CMMOpen                            (UInt32 *                cmmStorage,
  280.                                  void *                    hInstance);
  281.  
  282. EXTERN_API( CMError )
  283. CMMClose                        (UInt32 *                cmmStorage);
  284.  
  285. EXTERN_API( CMError )
  286. CMMGetCMMInfo                    (UInt32 *                cmmStorage,
  287.                                  CMMInfo *                info);
  288.  
  289. EXTERN_API( CMError )
  290. NCMMInit                        (UInt32 *                cmmStorage,
  291.                                  CMProfileRef             srcProfile,
  292.                                  CMProfileRef             dstProfile);
  293.  
  294. EXTERN_API( CMError )
  295. CMMMatchColors                    (UInt32 *                cmmStorage,
  296.                                  CMColor *                colors,
  297.                                  UInt32                 count);
  298.  
  299. EXTERN_API( CMError )
  300. CMMCheckColors                    (UInt32 *                cmmStorage,
  301.                                  CMColor *                colors,
  302.                                  UInt32                 count,
  303.                                  UInt32 *                result);
  304.  
  305. EXTERN_API( CMError )
  306. CMMValidateProfile                (UInt32 *                cmmStorage,
  307.                                  CMProfileRef             prof,
  308.                                  Boolean *                valid);
  309.  
  310. EXTERN_API( CMError )
  311. CMMMatchBitmap                    (UInt32 *                cmmStorage,
  312.                                  CMBitmap *                bitmap,
  313.                                  CMBitmapCallBackUPP     progressProc,
  314.                                  void *                    refCon,
  315.                                  CMBitmap *                matchedBitmap);
  316.  
  317. EXTERN_API( CMError )
  318. CMMCheckBitmap                    (UInt32 *                cmmStorage,
  319.                                  const CMBitmap *        bitmap,
  320.                                  CMBitmapCallBackUPP     progressProc,
  321.                                  void *                    refCon,
  322.                                  CMBitmap *                resultBitmap);
  323.  
  324. EXTERN_API( CMError )
  325. CMMMatchPixMap                    (UInt32 *                cmmStorage,
  326.                                  PixMap *                pixMap,
  327.                                  CMBitmapCallBackUPP     progressProc,
  328.                                  void *                    refCon);
  329.  
  330. EXTERN_API( CMError )
  331. CMMCheckPixMap                    (UInt32 *                cmmStorage,
  332.                                  const PixMap *            pixMap,
  333.                                  CMBitmapCallBackUPP     progressProc,
  334.                                  BitMap *                bitMap,
  335.                                  void *                    refCon);
  336.  
  337. EXTERN_API( CMError )
  338. CMMConcatInit                    (UInt32 *                cmmStorage,
  339.                                  CMConcatProfileSet *    profileSet);
  340.  
  341. EXTERN_API( CMError )
  342. NCMMConcatInit                    (UInt32 *                cmmStorage,
  343.                                  NCMConcatProfileSet *    profileSet,
  344.                                  CMConcatCallBackUPP     proc,
  345.                                  void *                    refCon);
  346.  
  347. EXTERN_API( CMError )
  348. CMMNewLinkProfile                (UInt32 *                cmmStorage,
  349.                                  CMProfileRef *            prof,
  350.                                  const CMProfileLocation * targetLocation,
  351.                                  CMConcatProfileSet *    profileSet);
  352.  
  353. EXTERN_API( CMError )
  354. NCMMNewLinkProfile                (UInt32 *                cmmStorage,
  355.                                  CMProfileRef             prof,
  356.                                  NCMConcatProfileSet *    profileSet,
  357.                                  CMConcatCallBackUPP     proc,
  358.                                  void *                    refCon);
  359.  
  360. EXTERN_API( CMError )
  361. CMMGetPS2ColorSpace                (UInt32 *                cmmStorage,
  362.                                  CMProfileRef             srcProf,
  363.                                  UInt32                 flags,
  364.                                  CMFlattenUPP             proc,
  365.                                  void *                    refCon);
  366.  
  367. EXTERN_API( CMError )
  368. CMMGetPS2ColorRenderingIntent    (UInt32 *                cmmStorage,
  369.                                  CMProfileRef             srcProf,
  370.                                  UInt32                 flags,
  371.                                  CMFlattenUPP             proc,
  372.                                  void *                    refCon);
  373.  
  374. EXTERN_API( CMError )
  375. CMMGetPS2ColorRendering            (UInt32 *                cmmStorage,
  376.                                  CMProfileRef             srcProf,
  377.                                  CMProfileRef             dstProf,
  378.                                  UInt32                 flags,
  379.                                  CMFlattenUPP             proc,
  380.                                  void *                    refCon);
  381.  
  382. EXTERN_API( CMError )
  383. CMMGetPS2ColorRenderingVMSize    (UInt32 *                cmmStorage,
  384.                                  CMProfileRef             srcProf,
  385.                                  CMProfileRef             dstProf,
  386.                                  UInt32 *                vmSize);
  387.  
  388.  
  389. #endif  /* TARGET_API_MAC_OS8 */
  390.  
  391.  
  392. #if PRAGMA_STRUCT_ALIGN
  393.     #pragma options align=reset
  394. #elif PRAGMA_STRUCT_PACKPUSH
  395.     #pragma pack(pop)
  396. #elif PRAGMA_STRUCT_PACK
  397.     #pragma pack()
  398. #endif
  399.  
  400. #ifdef PRAGMA_IMPORT_OFF
  401. #pragma import off
  402. #elif PRAGMA_IMPORT
  403. #pragma import reset
  404. #endif
  405.  
  406. #ifdef __cplusplus
  407. }
  408. #endif
  409.  
  410. #endif /* __CMMCOMPONENT__ */
  411.  
  412.